home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / lists / mint / l_0799 / 619 < prev    next >
Encoding:
Internet Message Format  |  1994-08-27  |  3.5 KB

  1. From: itschere@techfak.uni-bielefeld.de
  2. Subject: XATTR structure for biosfs entries
  3. Date: Tue, 9 Nov 93 15:40:25 MET
  4.  
  5. printf("Hello world!\n");
  6.  
  7.   As the subject line says, I want to bring the topic of each "file" in the
  8. bios device directory /dev having ownership, filemodes and c/m/a-time fields,
  9. say, a complete XATTR structure, "on stage". It would look like this:
  10.  
  11. struct bios_file {
  12.     char    name[BNAME_MAX+1];    /* device name */
  13.     DEVDRV    *device;        /* device driver for device */
  14.     short    private;        /* extra info for device driver */
  15.     ushort    flags;            /* flags for device open */
  16.     struct tty *tty;        /* tty structure (if appropriate) */
  17.     struct bios_file *next;
  18.     short    lockpid;        /* owner of the lock */
  19.     XATTR    xattr;            /* guess what... */
  20. };
  21.  
  22.   I've myself given it such an extention for MiNT 1.04 and 1.08 and now would
  23. like to redo it - perhaps better - for 1.09 and offer it through this channel.
  24.  
  25.   Now what I want to discuss is one small/big (depends on from which side you
  26. see it :-) problem. Changes inside the biosfs.c are all quite easily done and
  27. not at all the problem (so why hasn't anybody already done it?). The problem
  28. are the extra device drivers, weather they're installed by Dcntl() or as a XDD
  29. driver doesn't matter.
  30.  
  31.   The problem is how to change mtime/atime for these drivers? Obviously the
  32. change is best made in the read/write calls, but the biosfs can't do it since
  33. it's not touched when an extra device driver does I/O. On the other hand side
  34. the device driver has only _direct_ access to the filepointer...
  35.  
  36. typedef struct fileptr {
  37.     short    links;        /* number of copies of this descriptor */
  38.     ushort    flags;        /* file open mode and other file flags */
  39.     long    pos;        /* position in file */
  40.     long    devinfo;    /* device driver specific info */
  41.     fcookie    fc;        /* file system cookie for this file */
  42.     struct devdrv *dev;    /* device driver that knows how to deal with this */
  43.     struct fileptr *next;    /* link to next fileptr for this file */
  44. } FILEPTR;
  45.  
  46.   So I've thought about the following ideas:
  47.  
  48. 1) Change the f_read/f_write code in dosfile.c so that bios devices are
  49. recognized and a seperate time-field update is done. Does this sound good?
  50.  
  51. 2) Use the pos or devinfo field from the filepointer as a pointer to the
  52. XATTR structure so that the driver can access it and thereby modify it. But
  53. what happens if one driver likes to use them for his own purpose?
  54.  
  55. 3) Use the way (struct bios_file *)fileptr->fc.index to gain access over the
  56. the biosfs internal data, and automatically, the XATTR structure. Well, that's
  57. the way it'll be done inside the biosfs.c, but for external device drivers
  58. it may be a bad idea if they're running on an older version of MiNT without
  59. these extention.
  60.  
  61. 4) Add a pointer to a XATTR structure to the fileptr definition. Wouldn't
  62. necessarily involve great changes in other parts, and sounds quite compatible,
  63. but you could then also use idea 3.
  64.  
  65.   In any case, except 1, the installation part of the device driver must
  66. check the current version of MiNT running in order to decide if it can do
  67. these updates or not, while older ones may choose to ignore it. Seen from
  68. that point of view, something like idea 1 might perhaps do well.
  69.  
  70.   Or has anybody out there a better idea? Maybe I couldn't see the forest
  71. for the trees ones again... ;-)
  72.  
  73. bye,
  74. TeSche
  75. -- 
  76. PS: If the above written looks weird, than that's because it probably IS.
  77. WhoDunnIt: Torsten Scherer (Schiller, TeSche...)
  78. Technical Faculty, University of Bielefeld, Germany (52'5"N 8'35"E)
  79. EMail: itschere@techfak.uni-bielefeld.de / tesche@dave.hrz.uni-bielefeld.de
  80.